#ifndef PUNCTUATIONSVIEW_H
#define PUNCTUATIONSVIEW_H

#include "view/softkeyboard.h"
#include <QWidget>
#include <QList>
#include <QGridLayout>
#include <QToolButton>
#include <QDebug>
#include <QPropertyAnimation>
#include <QEvent>
#include <QLatin1Char>
#include <QStringList>
#include "mypushbutton.h"
#include "myvdragabletranslateview.h"
#include "mydragablewidget.h"

class PunctuationsView : public QWidget
{
    Q_OBJECT

public:
    explicit PunctuationsView(SoftKeyboard *parent = nullptr);
    ~PunctuationsView();

    PunctuationsView(QWidget *parent);

    QStringList loadSymbols(const QString &file);

    void initPunctuation();
    void initKeyPunctuation();
    void initKeyboard();
    void setRightToolWidget();
    void changePage();

    int page = 1;
    QGridLayout *gridLayout;
    QToolButton* renderButton(QString);
    //获取用户点击的按钮的值
    void getValue(QString value);

    //右侧工具栏__相关
    //删除按钮
    MyPushButton *btnDel;
    //确认按钮
    MyPushButton *btnSure;
    //abc按钮
    MyPushButton *btnabc;
    //123按钮
    MyPushButton *btn123;
    //字符按钮
    MyPushButton *btnLast;
    //键盘按钮
    MyPushButton *btnBack;
    //右侧工具栏布局
    QVBoxLayout *layout;


public slots:
    void userSelectPunctuation(const QString &text, int index);

private:
//    Ui::PunctuationsView *ui;

    SoftKeyboard *parent;
    MyDragableWidget            *VDragableWidget;  //字符拖拽控件

    QList<QToolButton*> keyBtns;
//    QList<QToolButton*> keyBtns2;
    QStringList punctuation1 = {
        ".","@","~","-"
       ,",",":","*","?"
       ,"!","_","#","%"
       ,"=","+","$","&"
       ,"^",";","/","|"
       ,"(",")","{","}"
    };
    QStringList punctuation2 = {
        "，","。","？","！"
         ,"~","、","：","；"
         ,"‘","’","“","”"
         ,"（","）","【","】"
         ,"《","》","……","——"
         ,"www.",".com",".cn",".net"
    };

};

#endif // PUNCTUATIONSVIEW_H
